home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / Divers / DinkClass ƒ / DinkClass / DWindow.h < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.7 KB  |  115 lines  |  [TEXT/KAHL]

  1. /*
  2.     File:        DWindow.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Mark Gross
  7.  
  8.     Copyright:    © 1992 by Applied Technical Software, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <4>    12/31/92    MTG        making the code conditionaly compiled so         that I am
  13.                                     always working with a current         version in either think c
  14.                                     or MPW C++
  15.          <3>    11/14/92    MTG        Bringing the C++ version up to date WRT the ThinkC version.
  16.          <2>     9/20/92    MTG        Bringing C++ version up to date with the THINK C version
  17.  
  18.     To Do:
  19. */
  20.  
  21.  
  22. // This is the class declaration of the DWindow object
  23.  
  24. #ifndef __DWINDOW__
  25. #define __DWINDOW__
  26.  
  27. #include "DEventHandler.h"
  28. #include <Printing.h>
  29.  
  30. class DDocument;    // forard declaration of the DDocument class
  31.                     // its refrence is needed for the getting of
  32.                     // the data needed to render the window
  33.                     
  34.  
  35. class DWindow : public DEventHandler
  36. {
  37. protected:
  38.  
  39.     short            fVOffSet;
  40.     short            fHOffSet;
  41.         // These offests are used in the "Focusing" opperations
  42.         // which are used when multiple coordinate systems
  43.         // are needed (like when scrolling)
  44.         
  45.     THPrint            fPrintRecord;
  46.     Rect            fGrowWindowLimits;
  47.         // the max and mins that the window is allowd to grow.
  48.  
  49. public:
  50.  
  51.     DDocument *fDoc;
  52.  
  53.     WindowPtr fWindowPtr;
  54.         
  55.     DWindow(void);
  56.  
  57.     ~DWindow(void);
  58.     
  59.     virtual Boolean Init(DDocument *doc, Boolean hasColorWindows);
  60.     
  61.     virtual void    FocusOnContent(void);    
  62.         // set the QuickDraw globals to use the offsets
  63.         // to define the drawing coordinate system
  64.         
  65.     void    FocusOnWindow(void);
  66.         // Set the drawing coordinate system to be screen coordinates
  67.     
  68.     void    GetContentRect(Rect *r);
  69.         // return the rectangle defined by the intierior of a window
  70.  
  71.     virtual void Draw( Rect *area);
  72.             // This gets called from the upDate Event handler
  73.             // override for this subclass of DEventHandler
  74.     
  75.     virtual Boolean KillMeNext(void);
  76.             //  in responce to 
  77.             // a mouseDown event in the close box of the window or the
  78.             // prober menu selection.
  79.  
  80.     virtual void HandleMouseDown(EventRecord *theEvent, short thePart, WindowPtr theWindow);
  81.  
  82.     virtual void HandleUpdateEvt(EventRecord *theEvent);
  83.     virtual void HandleActivateEvt(EventRecord *theEvent);
  84.     
  85.     void SetWindowTitle(void);
  86.     
  87. protected:
  88.     virtual void DoDrag(EventRecord *theEvent);
  89.     virtual void DoGrow(EventRecord *theEvent);
  90.     virtual void DoZoom(short thePart);
  91.     
  92.     virtual void DoContent(EventRecord *theEvent);
  93.  
  94. public:
  95.  
  96.     virtual void DoPageSetUp(void);
  97.     virtual void DoPrint(void);
  98.  
  99.  
  100. };// end of class declaration for the DWindow Class of objects
  101.  
  102. #define rWindowID 1000
  103. #define kStagger    20
  104. #define MINHIGHT    75
  105. #define MINWIDTH    75
  106.  
  107. #define rHScroll    1
  108. #define rVScroll    2
  109. #define kScrollOverlap    16
  110.  
  111. #define kScrollBarWidth    16
  112. #define kScrollBarPos    15
  113.  
  114. #endif __DWINDOW__
  115.